
<?php

$data_count = count($data);
?>

<div class="iscroll-empty-wrap">
    <div style="margin-bottom: 10px; height: 52px; background-color: #FFF; font-size: 15px; padding: 6px 16px; line-height: 40px; color: #e82e2e;">
        <span style="float: right; font-size: 16px;">共<?php echo $desc['sum']; ?>元</span>
        <?= $desc['count']?>
    </div>
    <hr style="height: 1%;background-color: #e5e5e5;margin: 0px">
    <?php if(empty($data)): ?>
        <ul class="bonus-list">
            <li style="padding: 100px 0; text-align: center; color: #a7a7a7; border: none; font-size: 12px;">
                暂无记录~~
            </li>
        </ul>
    <?php else: ?>
        <ul class="bonus-list <?= $type?>">


            <?php foreach($data as $d): ?>
                <?php if($type=='trades'):?>
                    <!--            交易记录-->
                    <li>
                        <span style="padding-left: 20px; float: right; color: green;padding-top: 3.5%">
                           <?php if($d->is_get_redpack==1 || $d->get_redpack_type==TradeDetail::GET_REDPACK_TYPE6):?>
                               已领取
                           <?php elseif($d->get_redpack_type==TradeDetail::GET_REDPACK_TYPE1 && $d->is_get_redpack==0 && $d->amount_due>=TradeDetail::LIMIT_AMOUNT) :?>

                               <button class="get_discount_botton" onclick="getRedPack(this,<?= $d->id_tradedetail?>,<?= $d->id_merchant?>)">

                               领取
                                </button>
                           <?php endif;?>
                        </span>

                        <?php echo date('Y-m-d H:i', strtotime($d->createtime)); ?><br />
                        <span style="color: #aaa; font-size: 12px;">
                                        在 <?php echo $d->merchant_name;  ?>消费

                    </span>
                    </li>

                <?php else:?>
                    <!-- 红包记录-->
                    <li>
                    <span style="background: url('/resources/frontend/images/dollor-small.png') no-repeat; background-size: 10px; background-position: left center; padding-left: 20px; float: right; font-size: 15px; line-height: 40px; color: #e82e2e;">
                        <?php echo $d->bonus; ?>元
                    </span>
                        <?php echo date('Y-m-d H:i', strtotime($d->createtime)); ?><br />
                        <span style="color: #aaa; font-size: 12px;">
                                        在 <?php echo $d->merchant_name;  ?>
                            <?php echo $type == 'uses'? '使用' : '获得'; ?>红包
                    </span>
                    </li>
                <?php endif;?>
            <?php endforeach; ?>


            <?php if($data_count < $default_limit):?>
                <li style="text-align: center; color: #a7a7a7; border: none; font-size: 12px;" class="isend">
                    到底了，木有了~~
                </li>
            <?php endif;?>
        </ul>

        <div class="more <?php echo $data_count < $default_limit?'hidden':''?>"><i class="pull_icon"></i><span>上拉加载...</span></div>

    <?php endif; ?>
</div>
